Integrand size = 41, antiderivative size = 109 \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {2 a^2 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {a^2 (i A+3 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {a^2 B (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)} \]
[Out]
Time = 0.20 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78} \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {2 a^2 (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac {a^2 (3 B+i A) (c-i c \tan (e+f x))^{n+1}}{c f (n+1)}+\frac {a^2 B (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)} \]
[In]
[Out]
Rule 78
Rule 3669
Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}\left (\int (a+i a x) (A+B x) (c-i c x)^{-1+n} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {(a c) \text {Subst}\left (\int \left (2 a (A-i B) (c-i c x)^{-1+n}-\frac {a (A-3 i B) (c-i c x)^n}{c}-\frac {i a B (c-i c x)^{1+n}}{c^2}\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {2 a^2 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {a^2 (i A+3 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {a^2 B (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)} \\ \end{align*}
Time = 2.18 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.82 \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {a^2 (c-i c \tan (e+f x))^n \left (-i A (2+n)^2-B (4+n)+n (A (2+n)-i B (4+n)) \tan (e+f x)+B n (1+n) \tan ^2(e+f x)\right )}{f n (1+n) (2+n)} \]
[In]
[Out]
Time = 1.04 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.53
method | result | size |
derivativedivides | \(\frac {\left (i A \,a^{2} n^{2}+4 i A \,a^{2} n +4 i A \,a^{2}+B \,a^{2} n +4 B \,a^{2}\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f n \left (2+n \right )}-\frac {B \,a^{2} \tan \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {a^{2} \left (-i B n +A n -4 i B +2 A \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right ) \left (2+n \right )}\) | \(167\) |
default | \(\frac {\left (i A \,a^{2} n^{2}+4 i A \,a^{2} n +4 i A \,a^{2}+B \,a^{2} n +4 B \,a^{2}\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f n \left (2+n \right )}-\frac {B \,a^{2} \tan \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {a^{2} \left (-i B n +A n -4 i B +2 A \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right ) \left (2+n \right )}\) | \(167\) |
norman | \(\frac {\left (i A \,a^{2} n^{2}+4 i A \,a^{2} n +4 i A \,a^{2}+B \,a^{2} n +4 B \,a^{2}\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f n \left (2+n \right )}-\frac {B \,a^{2} \tan \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {a^{2} \left (-i B n +A n -4 i B +2 A \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right ) \left (2+n \right )}\) | \(167\) |
risch | \(\text {Expression too large to display}\) | \(2205\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (99) = 198\).
Time = 0.26 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.89 \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {2 \, {\left ({\left (-i \, A + B\right )} a^{2} n + 2 \, {\left (-i \, A - B\right )} a^{2} + {\left ({\left (-i \, A - B\right )} a^{2} n^{2} + 3 \, {\left (-i \, A - B\right )} a^{2} n + 2 \, {\left (-i \, A - B\right )} a^{2}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left ({\left (-i \, A + B\right )} a^{2} n^{2} - 4 i \, A a^{2} n + 4 \, {\left (-i \, A - B\right )} a^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{3} + 3 \, f n^{2} + 2 \, f n + {\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1482 vs. \(2 (87) = 174\).
Time = 1.25 (sec) , antiderivative size = 1482, normalized size of antiderivative = 13.60 \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\text {Too large to display} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 660 vs. \(2 (99) = 198\).
Time = 0.45 (sec) , antiderivative size = 660, normalized size of antiderivative = 6.06 \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {2 \, {\left ({\left ({\left (A + i \, B\right )} a^{2} c^{n} n^{2} + 4 \, A a^{2} c^{n} n + 4 \, {\left (A - i \, B\right )} a^{2} c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + {\left ({\left (A - i \, B\right )} a^{2} c^{n} n^{2} + 3 \, {\left (A - i \, B\right )} a^{2} c^{n} n + 2 \, {\left (A - i \, B\right )} a^{2} c^{n}\right )} 2^{n} \cos \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right ) + {\left ({\left (A + i \, B\right )} a^{2} c^{n} n + 2 \, {\left (A - i \, B\right )} a^{2} c^{n}\right )} 2^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - {\left ({\left (i \, A - B\right )} a^{2} c^{n} n^{2} + 4 i \, A a^{2} c^{n} n + 4 \, {\left (i \, A + B\right )} a^{2} c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) - {\left ({\left (i \, A + B\right )} a^{2} c^{n} n^{2} + 3 \, {\left (i \, A + B\right )} a^{2} c^{n} n + 2 \, {\left (i \, A + B\right )} a^{2} c^{n}\right )} 2^{n} \sin \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right ) - {\left ({\left (i \, A - B\right )} a^{2} c^{n} n + 2 \, {\left (i \, A + B\right )} a^{2} c^{n}\right )} 2^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )\right )}}{{\left ({\left (-i \, n^{3} - 3 i \, n^{2} - 2 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \cos \left (4 \, f x + 4 \, e\right ) + {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \sin \left (4 \, f x + 4 \, e\right ) + {\left (-i \, n^{3} - 3 i \, n^{2} - 2 \, {\left (i \, n^{3} + 3 i \, n^{2} + 2 i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) + 2 \, {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} \sin \left (2 \, f x + 2 \, e\right ) - 2 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n}\right )} f} \]
[In]
[Out]
\[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\int { {\left (B \tan \left (f x + e\right ) + A\right )} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \]
[In]
[Out]
Time = 11.54 (sec) , antiderivative size = 193, normalized size of antiderivative = 1.77 \[ \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {{\mathrm {e}}^{-e\,2{}\mathrm {i}-f\,x\,2{}\mathrm {i}}\,{\left (c-\frac {c\,\sin \left (e+f\,x\right )\,1{}\mathrm {i}}{\cos \left (e+f\,x\right )}\right )}^n\,\left (\frac {2\,a^2\,\left (2\,A-B\,2{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^2\,1{}\mathrm {i}+n\,3{}\mathrm {i}+2{}\mathrm {i}\right )}+\frac {2\,a^2\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,\left (A-B\,1{}\mathrm {i}\right )\,\left (n^2+3\,n+2\right )}{f\,n\,\left (n^2\,1{}\mathrm {i}+n\,3{}\mathrm {i}+2{}\mathrm {i}\right )}+\frac {2\,a^2\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,\left (n+2\right )\,\left (2\,A-B\,2{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^2\,1{}\mathrm {i}+n\,3{}\mathrm {i}+2{}\mathrm {i}\right )}\right )}{4\,{\cos \left (e+f\,x\right )}^2} \]
[In]
[Out]